package gold.digger;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by fanzhenyu02 on 2020/6/27.
 * common problem solver template.
 */
public class LC1736 {
    public long startExecuteTime = System.currentTimeMillis();


    class Solution {
        public String maximumTime(String time) {
            char times[] = new char[4];
            for (int i = 0; i < 4; i++) {
                times[i] = time.charAt(i < 2 ? i : i + 1);
            }
            String res = "";
            for (int i = 0; i < 4; i++) {
                if (times[i] == '?') {
                    switch (i) {
                        case 0:
                            times[0] = times[1] >= '4' && times[1] <= '9' ? '1' : '2';
                            break;
                        case 1:
                            times[1] = times[0] == '2' ? '3' : '9';
                            break;
                        case 2:
                            times[2] = '5';
                            break;
                        case 3:
                            times[3] = '9';
                            break;
                    }
                }
                res += times[i];
                if (i == 1) res += ":";
            }
            return res;
        }
    }

    public void run() {
        Solution solution = new Solution();
        List<Integer> list = new ArrayList<>();
        System.out.println(solution.toString());
    }

    public static void main(String[] args) throws Exception {
        LC1736 an = new LC1736();
        an.run();

        System.out.println("\ncurrent solution total execute time: " + (System.currentTimeMillis() - an.startExecuteTime) + " ms.");
    }
}
